package com.wgts.wgts.mvp.presenter.imp;

import com.wgts.wgts.mvp.model.IGuessingActivityModel;
import com.wgts.wgts.mvp.presenter.IGuessingActivityPresenter;
import com.wgts.wgts.mvp.view.IGuessingActivityView;
import com.wgts.wgts.netmodle.HttpResultSubscriber;
import com.wgts.wgts.netmodle.resp.GuessingListEntity;

import java.util.List;

/*
 *
 *   data:2018/10/1317:20
 *
 */public class GuessingActivityPresenter implements IGuessingActivityPresenter {
     private IGuessingActivityView view;
     private IGuessingActivityModel model;

    public GuessingActivityPresenter(IGuessingActivityView view, IGuessingActivityModel model) {
        this.view = view;
        this.model = model;
    }

    @Override
    public void initList() {
        model.initList(new HttpResultSubscriber<List<GuessingListEntity>>() {
            @Override
            public void onSuccess(List<GuessingListEntity> guessingListEntities) {
                view.initList(guessingListEntities);
            }

            @Override
            public void _onError(int status, String msg) {
                view.onError(status, msg);
            }
        });
    }
}
